package test;

import java.io.File;

public class GetLibPath {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		String path = "E:\\mapxtreme\\mapinfo_mapxtreme_java_edition_4.50_full\\MapXtreme-4.5.0\\lib";
		File f = new File(path);
		
		String classPath = "";
		classPath = getPath(f,classPath);
		System.out.println(classPath);
	}

	private static String getPath(File f,String path) {
		
		if(f.isDirectory()){
			File[] fs = f.listFiles();
			for(File ff: fs){
				path = getPath(ff, path);
			}
		}else if(f.getName().endsWith(".jar")){
			path = path+";%MapXtreme_Lib%\\"+f.getAbsolutePath().
					substring(f.getAbsolutePath().indexOf("lib\\")+"lib\\".length());
		}
		
		return path;
	}

}
